package com.example.cd5160866.urlapp.utils;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class Container {
    private static Context context;
    private static SharedPreferences preference;

    public static Context getContext() {
        return context;
    }

    public static SharedPreferences getPreference() {
        return preference;
    }

    public static SharedPreferences getPreference(String name) {
        return context.getSharedPreferences(name, Context.MODE_PRIVATE);
    }

    public static void init(Application application) {
        Container.context = application;
        preference = PreferenceManager.getDefaultSharedPreferences(context);
    }

}
